package com.common.controller;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.HashMap;

/**
 * @author sola
 */
@Controller
public class CommonController {

    private static final String INDEX="/index";

    @GetMapping("/{path}/index")
    public String index(@PathVariable("path") String path){

        return path+INDEX;
    }


    private LoadingCache<String, HashMap<String, Object>> loadingCache = CacheBuilder.newBuilder().build(
            new CacheLoader<String, HashMap<String, Object>>() {
                @Override
                public HashMap load(String s) throws Exception {
                    return null;
                }
            });


}
